package com.enjoyor.soa.traffic.core.efoms.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.enjoyor.soa.traffic.core.efoms.mapper.ICheckReportMapper;
import com.enjoyor.soa.traffic.core.efoms.service.ICheckReportService;
import com.enjoyor.soa.traffic.util.pojo.Page;

@Service
public class CheckReportService implements ICheckReportService{

	@Autowired
	private ICheckReportMapper iCheckReportMapper;
	@Override
	public Page getCheckReport(String devTypeCode,String startTime,String endTime,Page page,String searchFlag) {
		// TODO Auto-generated method stub
		Page pageResult = null;
		Map<String,Object> map = new HashMap<String, Object>();
		Page page2 = new Page<>();
		map.put("devTypeCode", devTypeCode);
		map.put("startTime", startTime);
		map.put("startTime", startTime);
		page.setMapBean(map);
		if(searchFlag.equals("DEVICE")){
			pageResult = iCheckReportMapper.getCheckReportForDevice(page);
		}else if(searchFlag.equals("PERSON")){
			pageResult = iCheckReportMapper.getCheckReportForPerson(page);
		}
		return pageResult;
	}

}
